#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QComboBox>
#include <QLineEdit>
#include <QPushButton>
#include <QSettings>
#include <QUrl>
#include <QMenu>
#include <QList>

#include "qmenubutton.h"
#include "dictionaryinterface.h"



class QListWidgetItem;
class Transliterator;


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    void loadPlugins();
    void showEvent(QShowEvent *);
public slots:
    void slotQuery();
    void slotQuery(QString);
    void slotTextChanged(QString);
    void slotWordListClicked(QListWidgetItem*);
    void slotChangeDictionary(int);
    void slotOpenLink(QUrl);

    void slotGenIdx();

    void dictFilterChanged();

    void showMeaning(QString);


private:
    Ui::MainWindow *ui;

    QSettings *settings;

    QLineEdit *inputEdit;
    QComboBox *dictCombo;

    QPushButton *queryBtn;

    QMenuButton *menuBtn;

    QAction * inputAction;

    QAction * filterAction;

    QAction * genIdxAction;


    /*MonierSEDict *sedict;
    MonierESDict *esdict;*/
    Transliterator *transliterator;

    QObject *currentDict;

    QList<QObject *> dictionaryList;

};

#endif // MAINWINDOW_H
